package com.itheima.controller;

import com.itheima.mapper.StudentMapper;
import com.itheima.pojo.Report;
import com.itheima.pojo.ReportClazzCount;
import com.itheima.pojo.ReportCount;
import com.itheima.pojo.Result;
import com.itheima.service.ReportService;
import com.itheima.service.StudentService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

@RestController
@RequestMapping("/report")
public class ReportController {
    @Autowired
    private ReportService reportService;
    @GetMapping("/empGenderData")
    public Result genderCount(){
        List<Report> reports = reportService.genderCount();
        return Result.success(reports);
    }
    @GetMapping("/empJobData")
    public Result jobCount(){
        ReportCount reportCount = reportService.JobCount();
        return Result.success(reportCount);
    }
    @GetMapping("/studentDegreeData")
    public Result studentCount(){
         List<Report> reports = reportService.studentCount();
        return Result.success(reports);
    }
    @GetMapping("/studentCountData")
    public Result clazzCount(){
        ReportClazzCount reportStudentCount = reportService.studentCountPop();
        return Result.success(reportStudentCount);
    }
}
